This repository was archived by the owner on Jul 19, 2022. It is now read-only.
Add a Keyboard Shortcuts help modal #88
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Enable the user to click "Keyboard Shortcuts" in the lower left of the
sidebar or press "?" on the keyboard to open a modal with the
keyboard shortcuts
Fixes #86 and #80
Implementation notes
the Operating System of the client to allow for "Meta" to be
translated to the Windows key and Cmd key appropriately
fitted to their content.
way to construct shortcut indicators if needed
with clear defaults (Finder is a uniquely styled modal and the new
Help modal will be default style).
Interesting/controversial decisions
Dealing with the OS is a bit of a pain, and Firefox apparently handles the windows key
in a weird way (though slated to be fixed at some point).
I'm doing the OS detecting in JS only right now, but this could be moved to Elm by passing in
window.navigatoras flags. This is then passed to KeyboardShortcut init to make it easy to alwayshave the OS handy when rendering shortcuts.
This could alternatively be done with
portsand have the KeyboardShortcut module fetchthe os from JavaScript land on
init, but that mean dealing with the value being async.